<template :pageProps="pageProps">
  <el-pagination class="pagination-vm"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="pageProps.currentPage"
    :page-sizes="pageProps.pageSizes"
    :page-size="pageProps.pageSize"
    :layout="pageProps.layout"
    :total="pageProps.total">
  </el-pagination>

</template>

<script>
export default {
  name: 'Pagination',
  props: {
    pageProps: {
      type: Object,
      default() {
        return {
          layout: 'total, sizes, prev, pager, next, jumper',
          currentPage: 1,
          pageSize: 10,
          pageSizes: [10],
          total: 0
        }
      }
    }
  },
  data() {
    return {}
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('pageSizeChange', val)
    },
    handleCurrentChange(val) {
      this.$emit('pageCurrentChange', val)
    }
  }
}
</script>

<style scoped>
</style>